package cn.piesat.scanning.business.ads;


import cn.hutool.core.date.DateUtil;

import java.io.File;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
import java.util.List;

public class test {
    public static void main(String[] args) throws ParseException {
        String a ="D:\\a\\b\\2021\\2021011";
        File file = new File(a);
        if (!file.exists()){
            file.mkdirs();
        }
//        SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmss");
//        Date endDate = sdf.parse("20220704000000");
//        Calendar cal = Calendar.getInstance();
//        cal.setTime(endDate);
//        cal.add(Calendar.HOUR_OF_DAY, -24);
//        String endTime = sdf.format(cal.getTime());
//        String staTime ="";
//        System.out.println(DateUtil.dayOfWeek(cal.getTime()));
//        if (1==DateUtil.dayOfWeek(cal.getTime())){
//            cal.add(Calendar.HOUR_OF_DAY, -24*6);
//            staTime = sdf.format(cal.getTime());
//        }
//        System.out.println(staTime);
    }
    private static List<Date> getTimeZones(String startTime, String endTime){
        SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd");
        List<Date> list = new ArrayList<Date>();
        try {
            Date startDate = sdf.parse(startTime);
            Date endDate = sdf.parse(endTime);
            for (long i = (startDate.getTime()-(24*60*60*1000)); i < endDate.getTime(); i++) {
                i += (24*60*60*1000);
                Date date = new Date();
                date.setTime(i);
                list.add(date);
            }
        } catch (ParseException e) {
            e.printStackTrace();
        }
        return list;
    }
}
